//
//  OpHomeModel.m
//  LoveBeeProject
//
//  Created by skywalker on 17/1/8.
//  Copyright © 2017年 斯芬克斯. All rights reserved.
//

#import "OpHomeModel.h"
@implementation OpHomeModel
- (void)loadDataWithHomeMethod:(network)method url:(NSString *)urlstr parameters:(id)parameters success:(void(^)(id responseobject))successBlock failure:(void(^)(NSError *error))failureBlock {
    
    
    [[Networking sharedNetworking] loadDataWithMethod:method url:urlstr parameters:parameters success:^(id responseobject) {
        
        NSDictionary *result = responseobject;
        NSArray *dictArr = result[@"data"];
        //字典转模型
        NSArray *arrM = [NSArray yy_modelArrayWithClass:[OpHomeModel class] json:dictArr];
        
        NSLog(@"%@----%@",result,arrM);
        
        if (successBlock) {
            
            successBlock(arrM);
        }
        
        
        
    } failure:^(NSError *error) {
        
        if (failureBlock) {
            
            failureBlock(error);
        }
        
    }];
    
    
}


@end
